import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -06
 * Time: 16:30
 */

class Student implements Comparable {
    private String name;
    private int score;
    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }
    @Override
    public String toString() {
        return "[" + this.name + ":" + this.score + "]";
    }
    @Override
    public int compareTo(Object o) {
        return ((Student)o).score-score;
    }
}

public class Main {
    public static void main(String[] args) {
        Student[] students=new Student[]{
                new Student("zhangsan",88),
                new Student("lisi",78),
                new Student("wangwu",68),
                new Student("kunkun",98),
        };
        Arrays.sort(students);
        System.out.println(Arrays.toString(students));
    }
}
